Phil Elwell [Tue, 24 Feb 2015 13:40:50 +0000 (13:40 +0000)]
pinctrl-bcm2835: Fix interrupt handling for GPIOs 28-31 and 46-53
Contrary to the documentation, the BCM2835 GPIO controller actually has
four interrupt lines - one each for the three IRQ groups and one common. Rather
confusingly, the GPIO interrupt groups don't correspond directly with the GPIO
control banks. Instead, GPIOs 0-27 generate IRQ GPIO0, 28-45 GPIO1 and
46-53 GPIO2.
Awkwardly, the GPIOS for IRQ GPIO1 straddle two 32-entry GPIO banks, so it is
cleaner to split out a function to process the interrupts for a single GPIO
bank.
This bug has only just been observed because GPIOs above 27 can only be
accessed on an old Raspberry Pi with the optional P5 header fitted, where
the pins are often used for I2S instead.
notro [Thu, 10 Jul 2014 11:59:47 +0000 (13:59 +0200)]
pinctrl-bcm2835: Set base to 0 give expected gpio numbering
Signed-off-by: Noralf Tronnes <notro@tronnes.org>
Phil Elwell [Tue, 30 Jun 2015 13:12:42 +0000 (14:12 +0100)]
serial: 8250: Don't crash when nr_uarts is 0
Phil Elwell [Tue, 14 Jul 2015 09:26:09 +0000 (10:26 +0100)]
spidev: Add "spidev" compatible string to silence warning
See: https://github.com/raspberrypi/linux/issues/1054
Noralf Trønnes [Fri, 23 Oct 2015 14:26:55 +0000 (16:26 +0200)]
irqchip: irq-bcm2835: Add 2836 FIQ support
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Noralf Trønnes [Fri, 12 Jun 2015 17:01:05 +0000 (19:01 +0200)]
irqchip: bcm2835: Add FIQ support
Add a duplicate irq range with an offset on the hwirq's so the
driver can detect that enable_fiq() is used.
Tested with downstream dwc_otg USB controller driver.
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
Phil Elwell [Fri, 4 Dec 2015 17:41:50 +0000 (17:41 +0000)]
irq-bcm2836: Prevent spurious interrupts, and trap them early
The old arch-specific IRQ macros included a dsb to ensure the
write to clear the mailbox interrupt completed before returning
from the interrupt. The BCM2836 irqchip driver needs the same
precaution to avoid spurious interrupts.
Spurious interrupts are still possible for other reasons,
though, so trap them early.
Eric Anholt [Fri, 19 Dec 2014 00:07:15 +0000 (16:07 -0800)]
mm: Remove the PFN busy warning
See commit
dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is
expected sometimes when using CMA. However, that commit still spams
my kernel log with these warnings.
Signed-off-by: Eric Anholt <eric@anholt.net>
Phil Elwell [Fri, 13 Mar 2015 12:43:36 +0000 (12:43 +0000)]
Protect __release_resource against resources without parents
Without this patch, removing a device tree overlay can crash here.
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
popcornmix [Tue, 26 Mar 2013 17:26:38 +0000 (17:26 +0000)]
Allow mac address to be set in smsc95xx
Signed-off-by: popcornmix <popcornmix@gmail.com>
Sam Nazarko [Fri, 1 Apr 2016 16:27:21 +0000 (17:27 +0100)]
smsc95xx: Experimental: Enable turbo_mode and packetsize=2560 by default
See: http://forum.kodi.tv/showthread.php?tid=285288
Steve Glendinning [Thu, 19 Feb 2015 18:47:12 +0000 (18:47 +0000)]
smsx95xx: fix crimes against truesize
smsc95xx is adjusting truesize when it shouldn't, and following a recent patch from Eric this is now triggering warnings.
This patch stops smsc95xx from changing truesize.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Raspbian kernel package updater [Thu, 9 Mar 2017 17:49:20 +0000 (17:49 +0000)]
psudedomerge to tie in upstream history
Peter Michael Green [Thu, 9 Mar 2017 10:58:51 +0000 (10:58 +0000)]
Manually merge packaging changes from 4.4.6-1+rpi14 into 4.9.13-1 to produce packaging for 4.9.13-1+rpi1
Peter Michael Green [Thu, 5 May 2016 19:38:10 +0000 (19:38 +0000)]
extract packaging changes from 4.4.6-1+rpi14 (
33da3cd25ecef63a623a19de363dbb6abe8b6e4f)
Peter Michael Green [Tue, 3 May 2016 02:16:27 +0000 (02:16 +0000)]
extract packaging changes from 4.4.6-1+rpi13 (
e02140d83af8b48a23548fbb8ca7bc91fd510b78)
Peter Michael Green [Mon, 2 May 2016 14:59:12 +0000 (14:59 +0000)]
extract packaging changes from 4.4.6-1+rpi12 (
96ad38934b2a990852d69067b420a3f1db44b1aa)
Peter Michael Green [Mon, 2 May 2016 01:51:47 +0000 (01:51 +0000)]
extract packaging changes from 4.4.6-1+rpi11 (
c83ac06cc7dc54e5bbe640e0d10bcb6ee7c34a98)
Peter Michael Green [Sun, 1 May 2016 21:47:14 +0000 (21:47 +0000)]
extract packaging changes from 4.4.6-1+rpi10 (
ab290f338cf7a3e6cdba6f89a6d2386f42cfae55)
Peter Michael Green [Sat, 30 Apr 2016 23:47:50 +0000 (23:47 +0000)]
extract packaging changes from 4.4.6-1+rpi9 (
c7a2750925a16d42b65ae9719fa4352df91f192e)
Peter Michael Green [Thu, 28 Apr 2016 23:00:11 +0000 (23:00 +0000)]
extract packaging changes from 4.4.6-1+rpi8 (
75e6b122d71f25b2071c152cfed4410accccd0b4)
Peter Michael Green [Thu, 28 Apr 2016 18:09:56 +0000 (18:09 +0000)]
extract packaging changes from 4.4.6-1+rpi7 (
25a5c5f18d040109b773ff3db06c2a2886a7bf71)
Peter Michael Green [Thu, 28 Apr 2016 13:30:55 +0000 (13:30 +0000)]
extract packaging changes from 4.4.6-1+rpi6 (
d427241c43960e45bcea851351a1ba2f38e61af6)
Peter Michael Green [Tue, 26 Apr 2016 15:34:06 +0000 (15:34 +0000)]
extract packaging changes from 4.4.6-1+rpi5 (
6eb28159c97d4462390f54c83580c024dff4d103)
Peter Michael Green [Thu, 21 Apr 2016 21:08:58 +0000 (21:08 +0000)]
extract packaging changes from 4.4.6-1+rpi4 (
90b4503383138842ec068ce144b94ed359d0ee69)
Peter Michael Green [Tue, 19 Apr 2016 14:24:19 +0000 (14:24 +0000)]
extract packaging changes from 4.4.6-1+rpi3 (
7265e6aaeff323ae49b3e55c36c3da03fd8ea760)
Peter Michael Green [Sun, 17 Apr 2016 01:49:37 +0000 (01:49 +0000)]
extract packaging changes from 4.4.6-1+rpi2 (
fb687a494fd8d713b0741c597a37634daf9965b9)
Peter Michael Green [Thu, 14 Apr 2016 17:17:26 +0000 (17:17 +0000)]
extract packaging changes from 4.4.6-1+rpi1 (
e33ea30e7dd76c932c09abaac500661c4e9238cf)
Ben Hutchings [Mon, 27 Feb 2017 15:58:07 +0000 (15:58 +0000)]
Merge linux (4.9.13-1) import into refs/heads/workingbranch
Ben Hutchings [Tue, 14 Jun 2016 20:32:11 +0000 (21:32 +0100)]
liblockdep: Fix 'defined but not used' warning for init_utsname()
We define init_utsname() as static but not inline, resulting
in a warning for every source file that includes lockdep.h but
doesn't call it.
Since it is only used by lockdep.c, define it in there.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-fix-defined-but-not-used-warning-for-init.patch
Ben Hutchings [Tue, 14 Jun 2016 19:13:24 +0000 (20:13 +0100)]
liblockdep: Fix 'set but not used' warnings
liblockdep defines trivial macros for working with interrupt flags, as
interrupts are never disabled in userland. This results in warnings
from gcc when -Wunused-but-set-variable is enabled, and it is enabled
by -Wall. Fix this by evaluating the flags parameter and casting it to
void.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-fix-set-but-not-used-warnings.patch
Ben Hutchings [Tue, 14 Jun 2016 19:13:23 +0000 (20:13 +0100)]
liblockdep: Fix 'unused value' warnings
liblockdep defines various macros that may expand to an expression
with no effect, while the in-kernel definition does have an effect.
This results in warnings from gcc when -Wunused-value is enabled, and
is is enabled by -Wall. Fix this by introducing trivial functions,
as function return values are generally allowed to be ignored.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-fix-unused-value-warnings.patch
Ben Hutchings [Tue, 14 Jun 2016 20:26:01 +0000 (21:26 +0100)]
liblockdep: Enable -Wall by default
Regressions in liblockdep may be missed because it doesn't enable
warnings.
Adding -Wall immediately introduces a lot of warnings, but those will
be fixed by the following commits.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-enable-wall-by-default.patch
Ben Hutchings [Tue, 14 Jun 2016 20:14:14 +0000 (21:14 +0100)]
liblockdep: Define the ARRAY_SIZE() macro
lockdep.c now uses ARRAY_SIZE().
Fixes: 75dd602a5198 ("lockdep: Fix lock_chain::base size")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-define-the-array_size-macro.patch
Ben Hutchings [Tue, 14 Jun 2016 19:44:14 +0000 (20:44 +0100)]
liblockdep: Reduce MAX_LOCK_DEPTH to avoid overflowing lock_chain::depth
liblockdep has been broken since commit
75dd602a5198 ("lockdep: Fix
lock_chain::base size"), as that adds a check that MAX_LOCK_DEPTH is
within the range of lock_chain::depth and in liblockdep it is much
too large.
That should have resulted in a compiler error, but didn't because:
- the check uses ARRAY_SIZE(), which isn't yet defined in liblockdep
so is assumed to be an (undeclared) function
- putting a function call inside a BUILD_BUG_ON() expression quietly
turns it into some nonsense involving a variable-length array
It did produce a compiler warning, but I didn't notice because
liblockdep already produces too many warnings if -Wall is enabled
(which I'll fix shortly).
Even before that commit, which reduced lock_chain::depth from 8 bits
to 6, MAX_LOCK_DEPTH was too large.
Cc: <stable@vger.kernel.org> # for versions before 4.6, use a value of 255
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-reduce-max_lock_depth-to-avoid-overflowin.patch
Ben Hutchings [Tue, 14 Jun 2016 20:09:19 +0000 (21:09 +0100)]
liblockdep: Fix undefined symbol prandom_u32
__lock_pin_lock() now calls prandom_u32() which is not defined in
liblockdep. __lock_pin_lock() and its caller lock_pin_lock() are dead
code in liblockdep, but we still need to provide a definition of
prandom_u32() in case lazy binding is disabled.
Fixes: e7904a28f533 ("locking/lockdep, sched/core: Implement a better ...")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name liblockdep-fix-undefined-symbol-prandom_u32.patch
Ben Hutchings [Thu, 3 Nov 2016 21:25:26 +0000 (15:25 -0600)]
cpupower: Fix checks for CPU existence
Calls to cpufreq_cpu_exists(cpu) were converted to
cpupower_is_cpu_online(cpu) when libcpupower was introduced and the
former function was deleted. However, cpupower_is_cpu_online()
returns 1 on success whereas cpufreq_cpu_exists() returned 0 on
success. It also does not distinguish physically absent and offline
CPUs, and does not set errno.
cpufreq-set has already been fixed (commit
c25badc9ceb6).
In cpufreq-bench, which prints an error message for offline CPUs,
properly distinguish and report the zero and negative cases.
Reported-by: Jose <jjorge@free.fr>
Reported-by: Julien RIVAUD <frnchfrgg@free.fr>
Cc: stable <stable@vger.kernel.org> # 4.7+
Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name cpupower-fix-checks-for-cpu-existence.patch
Ben Hutchings [Thu, 9 Jun 2016 22:35:08 +0000 (23:35 +0100)]
cpupower: Bump soname version
Several functions in the libcpupower API are renamed or removed in
Linux 4.7. This is an backward-incompatible ABI change, so the
library soname should change from libcpupower.so.0 to
libcpupower.so.1.
Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name cpupower-bump-soname-version.patch
Ben Hutchings [Sun, 20 Mar 2016 21:09:02 +0000 (21:09 +0000)]
tools lib traceevent: Fix use of uninitialized variables
Fix a number of correct warnings from gcc:
> plugin_function.c:133:6: warning: 'index' may be used uninitialized in this function [-Wmaybe-uninitialized]
> int index;
> ^
'index' is initialized only if indentation is wanted. Move the
printing of indentation using 'index' into the same if-statement.
> kbuffer-parse.c:339:27: warning: 'length' may be used uninitialized in this function [-Wmaybe-uninitialized]
> kbuf->next = kbuf->index + length;
> ^
> kbuffer-parse.c:297:15: note: 'length' was declared here
> unsigned int length;
> ^
'length' is not initialized when handling an OLD_RINGBUF_TYPE_TIME_EXTEND
record. Based on what trace-cmd does, set length = 0 in this case.
> kbuffer-parse.c: In function 'kbuffer_read_at_offset':
> kbuffer-parse.c:632:9: warning: 'data' may be used uninitialized in this function [-Wmaybe-uninitialized]
> return data;
> ^
'data' is not initialized if the offset is too small. Initialize it
to NULL so that the behaviour is the same as when the offset is too
large.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-lib-traceevent-fix-use-of-uninitialized-variables.patch
Ben Hutchings [Sun, 21 Feb 2016 15:33:15 +0000 (15:33 +0000)]
tools/build: Remove bpf() run-time check at build time
It is not correct to test that a syscall works on the build system's
kernel. We might be building on an earlier kernel version or with
security restrictions that block bpf().
Also fix the test for whether __NR_bpf is defined.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-build-remove-bpf-run-time-check-at-build-time.patch
Ben Hutchings [Tue, 29 Sep 2015 01:55:06 +0000 (02:55 +0100)]
alpha: uapi: Add support for __SANE_USERSPACE_TYPES__
This fixes compiler errors in perf such as:
tests/attr.c: In function 'store_event':
tests/attr.c:66:27: error: format '%llu' expects argument of type 'long long unsigned int', but argument 6 has type '__u64 {aka long unsigned int}' [-Werror=format=]
snprintf(path, PATH_MAX, "%s/event-%d-%llu-%d", dir,
^
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Tested-by: Michael Cree <mcree@orcon.net.nz>
Cc: stable@vger.kernel.org
Gbp-Pq: Topic bugfix/alpha
Gbp-Pq: Name alpha-uapi-add-support-for-__sane_userspace_types__.patch
Ben Hutchings [Fri, 25 Sep 2015 21:50:50 +0000 (22:50 +0100)]
Revert "perf build: Fix libunwind feature detection on 32-bit x86"
This reverts commit
05b41775e2edd69a83f592e3534930c934d4038e.
It broke feature detection that was working just fine for us.
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name revert-perf-build-fix-libunwind-feature-detection-on.patch
Ben Hutchings [Fri, 25 Sep 2015 19:28:10 +0000 (20:28 +0100)]
tools/hv: Fix fortify format warning
With fortify enabled, gcc warns:
tools/hv/hv_kvp_daemon.c:705:2: error: format not a string literal and no format arguments [-Werror=format-security]
snprintf(dev_id, sizeof(dev_id), kvp_net_dir);
^
kvp_net_dir is a pointer to a string literal, but lacks const
qualification. As it is never modified, it should be a const
array rather than a pointer.
Also, while snprintf() has a bounds check, the following strcat()s
do not. Combine them into a single snprintf().
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name tools-hv-fix-fortify-format-warning.patch
Ben Hutchings [Fri, 25 Sep 2015 20:36:29 +0000 (21:36 +0100)]
tools/lib/lockdep: Use LDFLAGS
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-lib-lockdep-use-ldflags.patch
Ben Hutchings [Fri, 25 Sep 2015 20:26:48 +0000 (21:26 +0100)]
tools/lib/traceevent: Use LDFLAGS
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-lib-traceevent-use-ldflags.patch
Ben Hutchings [Fri, 25 Sep 2015 19:09:23 +0000 (20:09 +0100)]
tools/perf: Remove shebang lines from perf scripts
perf scripts need to be invoked through perf, not directly through
perl (or other language interpreter). So including shebang lines in
them is useless and possibly misleading.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-perf-remove-shebangs.patch
Ben Hutchings [Thu, 13 Aug 2015 18:48:12 +0000 (20:48 +0200)]
liblockdep: Remove double-quotes from soname
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name lockdep-fix-soname.patch
Ben Hutchings [Thu, 13 Aug 2015 18:48:12 +0000 (20:48 +0200)]
liblockdep: Fix object file paths used in an out-of-tree build
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name lockdep-fix-oot-build.patch
Ben Hutchings [Mon, 13 Jul 2015 19:29:20 +0000 (20:29 +0100)]
perf tools: Use $KBUILD_BUILD_TIMESTAMP as man page date
This allows man pages to be built reproducibly.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name tools-perf-man-date.patch
Ben Hutchings [Mon, 8 Sep 2014 17:31:24 +0000 (18:31 +0100)]
kbuild: Fix recordmcount dependency for OOT modules
We never rebuild anything in-tree when building an out-of-tree
modules, so external modules should not depend on the recordmcount
sources.
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name kbuild-fix-recordmcount-dependency.patch
Ben Hutchings [Sun, 24 Jun 2012 01:51:39 +0000 (02:51 +0100)]
usbip: Document TCP wrappers
Add references to TCP wrappers configuration in the manual page.
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name usbip-document-tcp-wrappers.patch
Ben Hutchings [Sat, 18 Feb 2017 21:22:41 +0000 (21:22 +0000)]
net: Avoid ABI change for min_header_len
Adding net_device::min_header_len is a massive ABI break that we don't
want right now. Instead, check for the specific device types and
minimum length in dev_validate_header().
Gbp-Pq: Topic debian
Gbp-Pq: Name net-avoid-abi-change-for-min_header_len.patch
Ben Hutchings [Fri, 2 Dec 2016 23:06:18 +0000 (23:06 +0000)]
module: Disable matching missing version CRC
This partly reverts commit
cd3caefb4663e3811d37cc2afad3cce642d60061.
We want to fail closed if a symbol version CRC is missing, as the
alternative may allow subverting module signing.
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name module-disable-matching-missing-version-crc.patch
Ben Hutchings [Fri, 2 Dec 2016 01:26:54 +0000 (01:26 +0000)]
powerpc: Fix missing CRCs, add yet more asm-prototypes.h declarations
Add declarations for:
- __mfdcr, __mtdcr (if CONFIG_PPC_DCR_NATIVE=y; through <asm/dcr.h>)
- switch_mmu_context (if CONFIG_PPC_BOOK3S_64=n; through <asm/mmu_context.h>)
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/powerpc
Gbp-Pq: Name powerpc-fix-missing-crcs-add-yet-more-asm-prototypes.patch
Ben Hutchings [Fri, 2 Dec 2016 02:27:50 +0000 (02:27 +0000)]
powerpc: Remove Mac-on-Linux hooks
The symbols exported for use by MOL aren't getting CRCs and I was
about to fix that. But MOL is dead upstream, and the latest work on
it was to make it use KVM instead of its own kernel module. So remove
them instead.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/powerpc
Gbp-Pq: Name powerpc-remove-mac-on-linux-hooks.patch
Ben Hutchings [Thu, 1 Dec 2016 23:14:46 +0000 (23:14 +0000)]
Revert "alpha: move exports to actual definitions"
This reverts commit
00fc0e0dda6286407f3854cd71a125f519a5689c because
symbols exported from assembly don't automatically get modversions (ABI
hashes).
Gbp-Pq: Topic bugfix/alpha
Gbp-Pq: Name revert-alpha-move-exports-to-actual-definitions.patch
Ben Hutchings [Thu, 1 Dec 2016 23:14:09 +0000 (23:14 +0000)]
Revert "m68k: move exports to definitions"
This reverts commit
d13ffb5630443e6112df0263969cbdfc8ab9ab57 because
symbols exported from assembly don't automatically get modversions (ABI
hashes).
Gbp-Pq: Topic bugfix/m68k
Gbp-Pq: Name revert-m68k-move-exports-to-definitions.patch
Ben Hutchings [Thu, 1 Dec 2016 23:13:38 +0000 (23:13 +0000)]
Revert "s390: move exports to definitions"
This reverts commit
711f5df7bf3ae7657e15edf76d671042c051ce95 because
symbols exported from assembly don't automatically get modversions (ABI
hashes).
Gbp-Pq: Topic bugfix/s390
Gbp-Pq: Name revert-s390-move-exports-to-definitions.patch
Ben Hutchings [Thu, 12 Jan 2017 00:08:36 +0000 (00:08 +0000)]
Revert "sparc: move exports to definitions"
This reverts commit
d3867f0483103b8ff7edfdea3ef1981c03d96891 because
symbols exported from assembly don't automatically get modversions (ABI
hashes).
Commit
70a6fcf3283a "[sparc] unify 32bit and 64bit string.h" removed
the export of __memmove; don't try to export it again. It also
completely disabled declaration of prototypes of memscan, memcpy and
memset, which are defined as macros. gcc will still generate implicit
calls to memcpy and memset, so restore both exports and prototypes for
them. Don't restore the export of memscan.
Commit
aa95ce361ed9 "sparc64: Delete __ret_efault." did what it says;
don't try to export that symbol.
Gbp-Pq: Topic bugfix/sparc
Gbp-Pq: Name revert-sparc-move-exports-to-definitions.patch
Ben Hutchings [Thu, 1 Dec 2016 23:20:31 +0000 (23:20 +0000)]
Revert "ia64: move exports to definitions"
This reverts commit
e007c53397acb5554e226693e3bff54a312ccd96 because
symbols exported from assembly don't automatically get modversions (ABI
hashes).
Gbp-Pq: Topic bugfix/ia64
Gbp-Pq: Name revert-ia64-move-exports-to-definitions.patch
Marcelo Ricardo Leitner [Thu, 23 Feb 2017 12:31:18 +0000 (09:31 -0300)]
sctp: deny peeloff operation on asocs with threads sleeping on it
commit
2dcab5984841 ("sctp: avoid BUG_ON on sctp_wait_for_sndbuf")
attempted to avoid a BUG_ON call when the association being used for a
sendmsg() is blocked waiting for more sndbuf and another thread did a
peeloff operation on such asoc, moving it to another socket.
As Ben Hutchings noticed, then in such case it would return without
locking back the socket and would cause two unlocks in a row.
Further analysis also revealed that it could allow a double free if the
application managed to peeloff the asoc that is created during the
sendmsg call, because then sctp_sendmsg() would try to free the asoc
that was created only for that call.
This patch takes another approach. It will deny the peeloff operation
if there is a thread sleeping on the asoc, so this situation doesn't
exist anymore. This avoids the issues described above and also honors
the syscalls that are already being handled (it can be multiple sendmsg
calls).
Joint work with Xin Long.
Fixes: 2dcab5984841 ("sctp: avoid BUG_ON on sctp_wait_for_sndbuf")
Cc: Alexander Popov <alex.popov@linux.com>
Cc: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name sctp-deny-peeloff-operation-on-asocs-with-threads-sl.patch
Ben Hutchings [Sun, 26 Feb 2017 21:01:50 +0000 (21:01 +0000)]
time: Mark TIMER_STATS as broken
This is a substitute for upstream commit
dfb4357da6dd "time: Remove
CONFIG_TIMER_STATS", which avoids the need to resolve conflicts with
the PREEMPT_RT patch series.
Gbp-Pq: Topic debian
Gbp-Pq: Name time-mark-timer_stats-as-broken.patch
Davidlohr Bueso [Thu, 23 Feb 2017 00:41:32 +0000 (11:41 +1100)]
ipc/shm: Fix shmat mmap nil-page protection
The issue is described here, with a nice testcase:
https://bugzilla.kernel.org/show_bug.cgi?id=192931
The problem is that shmat() calls do_mmap_pgoff() with MAP_FIXED, and the
address rounded down to 0. For the regular mmap case, the protection
mentioned above is that the kernel gets to generate the address --
arch_get_unmapped_area() will always check for MAP_FIXED and return that
address. So by the time we do security_mmap_addr(0) things get funky for
shmat().
The testcase itself shows that while a regular user crashes, root will not
have a problem attaching a nil-page. There are two possible fixes to
this. The first, and which this patch does, is to simply allow root to
crash as well -- this is also regular mmap behavior, ie when hacking up
the testcase and adding mmap(... |MAP_FIXED). While this approach is the
safer option, the second alternative is to ignore SHM_RND if the rounded
address is 0, thus only having MAP_SHARED flags. This makes the behavior
of shmat() identical to the mmap() case. The downside of this is
obviously user visible, but does make sense in that it maintains semantics
after the round-down wrt 0 address and mmap.
Passes shm related ltp tests.
Link: http://lkml.kernel.org/r/1486050195-18629-1-git-send-email-dave@stgolabs.net
Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
Reported-by: Gareth Evans <gareth.evans@contextis.co.uk>
Cc: Manfred Spraul <manfred@colorfullife.com>
Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name ipc-shm-fix-shmat-mmap-nil-page-protection.patch
Paolo Bonzini [Tue, 24 Jan 2017 10:56:21 +0000 (11:56 +0100)]
kvm: fix page struct leak in handle_vmon
handle_vmon gets a reference on VMXON region page,
but does not release it. Release the reference.
Found by syzkaller; based on a patch by Dmitry.
Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
[bwh: Backported to 4.9: use skip_emulated_instruction()]
Gbp-Pq: Topic bugfix/x86
Gbp-Pq: Name kvm-fix-page-struct-leak-in-handle_vmon.patch
Ben Hutchings [Tue, 16 Feb 2016 02:45:42 +0000 (02:45 +0000)]
PCI: Set pci=nobios by default
CONFIG_PCI_GOBIOS results in physical addresses 640KB-1MB being mapped
W+X, which is undesirable for security reasons and will result in a
warning at boot now that we enable CONFIG_DEBUG_WX.
This can be overridden using the kernel parameter "pci=nobios", but we
want to disable W+X by default. Disable PCI BIOS probing by default;
it can still be enabled using "pci=bios".
Gbp-Pq: Topic debian
Gbp-Pq: Name i386-686-pae-pci-set-pci-nobios-by-default.patch
Linn Crosetto [Tue, 30 Aug 2016 17:54:38 +0000 (11:54 -0600)]
arm64: add kernel config option to set securelevel when in Secure Boot mode
Add a kernel configuration option to enable securelevel, to restrict
userspace's ability to modify the running kernel when UEFI Secure Boot is
enabled. Based on the x86 patch by Matthew Garrett.
Determine the state of Secure Boot in the EFI stub and pass this to the
kernel using the FDT.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name arm64-add-kernel-config-option-to-set-securelevel-wh.patch
Linn Crosetto [Mon, 22 Feb 2016 19:54:37 +0000 (12:54 -0700)]
arm64/efi: Disable secure boot if shim is in insecure mode
Port to arm64 a patch originally written by Josh Boyer for the x86 EFI
stub.
A user can manually tell the shim boot loader to disable validation of
images it loads. When a user does this, it creates a UEFI variable called
MokSBState that does not have the runtime attribute set. Given that the
user explicitly disabled validation, we can honor that and not enable
secure boot mode if that variable is set.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Cc: Josh Boyer <jwboyer@fedoraproject.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name arm64-efi-disable-secure-boot-if-shim-is-in-insecure.patch
Ben Hutchings [Thu, 2 Jun 2016 23:48:39 +0000 (00:48 +0100)]
mtd: Disable slram and phram when securelevel is enabled
The slram and phram drivers both allow mapping regions of physical
address space such that they can then be read and written by userland
through the MTD interface. This is probably usable to manipulate
hardware into overwriting kernel code on many systems. Prevent that
if securelevel is set.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name mtd-disable-slram-and-phram-when-securelevel-is-enabled.patch
Matthew Garrett [Tue, 12 Jan 2016 20:51:27 +0000 (12:51 -0800)]
Enable cold boot attack mitigation
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name enable-cold-boot-attack-mitigation.patch
Linn Crosetto [Wed, 16 Mar 2016 20:43:33 +0000 (14:43 -0600)]
acpi: Disable APEI error injection if securelevel is set
ACPI provides an error injection mechanism, EINJ, for debugging and testing
the ACPI Platform Error Interface (APEI) and other RAS features. If
supported by the firmware, ACPI specification 5.0 and later provide for a
way to specify a physical memory address to which to inject the error.
Injecting errors through EINJ can produce errors which to the platform are
indistinguishable from real hardware errors. This can have undesirable
side-effects, such as causing the platform to mark hardware as needing
replacement.
While it does not provide a method to load unauthenticated privileged code,
the effect of these errors may persist across reboots and affect trust in
the underlying hardware, so disable error injection through EINJ if
securelevel is set.
Signed-off-by: Linn Crosetto <linn@hpe.com>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name acpi-disable-apei-error-injection-if-securelevel-is-.patch
Linn Crosetto [Fri, 4 Mar 2016 23:08:24 +0000 (16:08 -0700)]
acpi: Disable ACPI table override if securelevel is set
From the kernel documentation (initrd_table_override.txt):
If the ACPI_INITRD_TABLE_OVERRIDE compile option is true, it is possible
to override nearly any ACPI table provided by the BIOS with an
instrumented, modified one.
When securelevel is set, the kernel should disallow any unauthenticated
changes to kernel space. ACPI tables contain code invoked by the kernel, so
do not allow ACPI tables to be overridden if securelevel is set.
Signed-off-by: Linn Crosetto <linn@hpe.com>
[bwh: Forward-ported to 4.7: ACPI override code moved to drivers/acpi/tables.c]
[bwh: Forward-ported to 4.9: adjust context]
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name acpi-disable-acpi-table-override-if-securelevel-is-s.patch
Dave Young [Tue, 6 Oct 2015 12:31:31 +0000 (13:31 +0100)]
kexec/uefi: copy secure_boot flag in boot params across kexec reboot
Kexec reboot in case secure boot being enabled does not keep the secure
boot mode in new kernel, so later one can load unsigned kernel via legacy
kexec_load. In this state, the system is missing the protections provided
by secure boot. Adding a patch to fix this by retain the secure_boot flag
in original kernel.
secure_boot flag in boot_params is set in EFI stub, but kexec bypasses the
stub. Fixing this issue by copying secure_boot flag across kexec reboot.
Signed-off-by: Dave Young <dyoung@redhat.com>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name kexec-uefi-copy-secure_boot-flag-in-boot-params-acro.patch
Josh Boyer [Fri, 20 Jun 2014 12:53:24 +0000 (08:53 -0400)]
hibernate: Disable when securelevel is set
There is currently no way to verify the resume image when returning
from hibernate. This might compromise the securelevel trust model,
so until we can work with signed hibernate images we disable it in
a secure modules environment.
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name hibernate-disable-when-securelevel-is-set.patch
Josh Boyer [Wed, 6 Feb 2013 00:25:05 +0000 (19:25 -0500)]
efi: Disable secure boot if shim is in insecure mode
A user can manually tell the shim boot loader to disable validation of
images it loads. When a user does this, it creates a UEFI variable called
MokSBState that does not have the runtime attribute set. Given that the
user explicitly disabled validation, we can honor that and not enable
secure boot mode if that variable is set.
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name efi-disable-secure-boot-if-shim-is-in-insecure-mode.patch
Matthew Garrett [Fri, 9 Aug 2013 22:36:30 +0000 (18:36 -0400)]
Add option to automatically set securelevel when in Secure Boot mode
UEFI Secure Boot provides a mechanism for ensuring that the firmware will
only load signed bootloaders and kernels. Certain use cases may also
require that the kernel prevent userspace from inserting untrusted kernel
code at runtime. Add a configuration option that enforces this automatically
when enabled.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name add-option-to-automatically-set-securelevel-when-in-.patch
Matthew Garrett [Fri, 9 Mar 2012 13:46:50 +0000 (08:46 -0500)]
asus-wmi: Restrict debugfs interface when securelevel is set
We have no way of validating what all of the Asus WMI methods do on a
given machine, and there's a risk that some will allow hardware state to
be manipulated in such a way that arbitrary code can be executed in the
kernel. Prevent that if securelevel is set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name asus-wmi-restrict-debugfs-interface-when-securelevel.patch
Matthew Garrett [Fri, 8 Feb 2013 19:12:13 +0000 (11:12 -0800)]
x86: Restrict MSR access when securelevel is set
Permitting write access to MSRs allows userspace to modify the running
kernel. Prevent this if securelevel has been set. Based on a patch by Kees
Cook.
Cc: Kees Cook <keescook@chromium.org>
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name x86-restrict-msr-access-when-securelevel-is-set.patch
Matthew Garrett [Tue, 3 Sep 2013 15:23:29 +0000 (11:23 -0400)]
uswsusp: Disable when securelevel is set
uswsusp allows a user process to dump and then restore kernel state, which
makes it possible to modify the running kernel. Disable this if securelevel
has been set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name uswsusp-disable-when-securelevel-is-set.patch
Matthew Garrett [Fri, 9 Aug 2013 07:33:56 +0000 (03:33 -0400)]
kexec: Disable at runtime if securelevel has been set.
kexec permits the loading and execution of arbitrary code in ring 0, which
permits the modification of the running kernel. Prevent this if securelevel
has been set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name kexec-disable-at-runtime-if-securelevel-has-been-set.patch
Josh Boyer [Mon, 25 Jun 2012 23:57:30 +0000 (19:57 -0400)]
acpi: Ignore acpi_rsdp kernel parameter when securelevel is set
This option allows userspace to pass the RSDP address to the kernel, which
makes it possible for a user to execute arbitrary code in the kernel.
Disable this when securelevel is set.
Signed-off-by: Josh Boyer <jwboyer@redhat.com>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name acpi-ignore-acpi_rsdp-kernel-parameter-when-securele.patch
Matthew Garrett [Fri, 9 Mar 2012 13:39:37 +0000 (08:39 -0500)]
acpi: Limit access to custom_method if securelevel is set
custom_method effectively allows arbitrary access to system memory, making
it possible for an attacker to modify the kernel at runtime. Prevent this
if securelevel has been set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name acpi-limit-access-to-custom_method-if-securelevel-is.patch
Matthew Garrett [Fri, 9 Mar 2012 14:28:15 +0000 (09:28 -0500)]
Restrict /dev/mem and /dev/kmem when securelevel is set.
Allowing users to write to address space provides mechanisms that may permit
modification of the kernel at runtime. Prevent this if securelevel has been
set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
[bwh: Forward-ported to 4.9: adjust context]
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name restrict-dev-mem-and-dev-kmem-when-securelevel-is-se.patch
Matthew Garrett [Thu, 8 Mar 2012 15:35:59 +0000 (10:35 -0500)]
x86: Lock down IO port access when securelevel is enabled
IO port access would permit users to gain access to PCI configuration
registers, which in turn (on a lot of hardware) give access to MMIO register
space. This would potentially permit root to trigger arbitrary DMA, so lock
it down when securelevel is set.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name x86-lock-down-io-port-access-when-securelevel-is-ena.patch
Matthew Garrett [Thu, 8 Mar 2012 15:10:38 +0000 (10:10 -0500)]
PCI: Lock down BAR access when securelevel is enabled
Any hardware that can potentially generate DMA has to be locked down from
userspace in order to avoid it being possible for an attacker to modify
kernel code. This should be prevented if securelevel has been set. Default
to paranoid - in future we can potentially relax this for sufficiently
IOMMU-isolated devices.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name pci-lock-down-bar-access-when-securelevel-is-enabled.patch
Matthew Garrett [Mon, 9 Sep 2013 12:46:52 +0000 (08:46 -0400)]
Enforce module signatures when securelevel is greater than 0
If securelevel has been set to 1 or greater, require that all modules have
valid signatures.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name enforce-module-signatures-when-securelevel-is-greate.patch
Matthew Garrett [Fri, 9 Aug 2013 21:58:15 +0000 (17:58 -0400)]
Add BSD-style securelevel support
Provide a coarse-grained runtime configuration option for restricting
userspace's ability to modify the running kernel.
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Gbp-Pq: Topic features/all/securelevel
Gbp-Pq: Name add-bsd-style-securelevel-support.patch
Ben Hutchings [Fri, 17 Feb 2017 02:51:21 +0000 (02:51 +0000)]
dvb-usb-dibusb-mc-common: Add MODULE_LICENSE
dvb-usb-dibusb-mc-common is licensed under GPLv2, and if we don't say
so then it won't even load since it needs a GPL-only symbol.
Reported-by: Dominique Dumont <dod@debian.org>
References: https://bugs.debian.org/853110
Cc: stable@vger.kernel.org # 4.9+
Fixes: e91455a1495a ("[media] dvb-usb: split out common parts of dibusb")
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name media-dvb-usb-dibusb-mc-common-add-module_license.patch
Mantas M [Fri, 16 Dec 2016 08:30:59 +0000 (10:30 +0200)]
net: ipv6: check route protocol when deleting routes
The protocol field is checked when deleting IPv4 routes, but ignored for
IPv6, which causes problems with routing daemons accidentally deleting
externally set routes (observed by multiple bird6 users).
This can be verified using `ip -6 route del <prefix> proto something`.
Signed-off-by: Mantas Mikulėnas <grawity@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name net-ipv6-check-route-protocol-when-deleting-routes.patch
Jens Axboe [Sat, 3 Dec 2016 19:08:03 +0000 (12:08 -0700)]
nbd: fix 64-bit division
We have this:
ERROR: "__aeabi_ldivmod" [drivers/block/nbd.ko] undefined!
ERROR: "__divdi3" [drivers/block/nbd.ko] undefined!
nbd.c:(.text+0x247c72): undefined reference to `__divdi3'
due to a recent commit, that did 64-bit division. Use the proper
divider function so that 32-bit compiles don't break.
Fixes: ef77b515243b ("nbd: use loff_t for blocksize and nbd_set_size args")
Signed-off-by: Jens Axboe <axboe@fb.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name nbd-fix-64-bit-division.patch
Miaoqing Pan [Wed, 16 Nov 2016 09:23:08 +0000 (17:23 +0800)]
ath9k: fix NULL pointer dereference
relay_open() may return NULL, check the return value to avoid the crash.
BUG: unable to handle kernel NULL pointer dereference at
0000000000000040
IP: [<
ffffffffa01a95c5>] ath_cmn_process_fft+0xd5/0x700 [ath9k_common]
PGD
41cf28067 PUD
41be92067 PMD 0
Oops: 0000 [#1] SMP
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.8.6+ #35
Hardware name: Hewlett-Packard h8-1080t/2A86, BIOS 6.15 07/04/2011
task:
ffffffff81e0c4c0 task.stack:
ffffffff81e00000
RIP: 0010:[<
ffffffffa01a95c5>] [<
ffffffffa01a95c5>] ath_cmn_process_fft+0xd5/0x700 [ath9k_common]
RSP: 0018:
ffff88041f203ca0 EFLAGS:
00010293
RAX:
0000000000000000 RBX:
000000000000059f RCX:
0000000000000000
RDX:
0000000000000000 RSI:
0000000000000040 RDI:
ffffffff81f0ca98
RBP:
ffff88041f203dc8 R08:
ffffffffffffffff R09:
00000000000000ff
R10:
0000000000000000 R11:
0000000000000000 R12:
0000000000000000
R13:
ffffffff81f0ca98 R14:
0000000000000000 R15:
0000000000000000
FS:
0000000000000000(0000) GS:
ffff88041f200000(0000) knlGS:
0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0:
0000000080050033
CR2:
0000000000000040 CR3:
000000041b6ec000 CR4:
00000000000006f0
Stack:
0000000000000363 00000000000003f3 00000000000003f3 00000000000001f9
000000000000049a 0000000001252c04 ffff88041f203e44 ffff880417b4bfd0
0000000000000008 ffff88041785b9c0 0000000000000002 ffff88041613dc60
Call Trace:
<IRQ>
[<
ffffffffa01b6441>] ath9k_tasklet+0x1b1/0x220 [ath9k]
[<
ffffffff8105d8dd>] tasklet_action+0x4d/0xf0
[<
ffffffff8105dde2>] __do_softirq+0x92/0x2a0
Reported-by: Devin Tuchsen <devin.tuchsen@gmail.com>
Tested-by: Devin Tuchsen <devin.tuchsen@gmail.com>
Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name ath9k-fix-null-pointer-dereference.patch
Josef Bacik [Fri, 2 Dec 2016 21:19:12 +0000 (16:19 -0500)]
nbd: use loff_t for blocksize and nbd_set_size args
If we have large devices (say like the 40t drive I was trying to test with) we
will end up overflowing the int arguments to nbd_set_size and not get the right
size for our device. Fix this by using loff_t everywhere so I don't have to
think about this again. Thanks,
Signed-off-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
[bwh: Backported to 4.9: adjust context]
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name nbd-use-loff_t-for-blocksize-and-nbd_set_size-args.patch
Ben Hutchings [Wed, 11 Jan 2017 04:30:40 +0000 (04:30 +0000)]
Partially revert "usb: Kconfig: using select for USB_COMMON dependency"
This reverts commit
cb9c1cfc86926d0e86d19c8e34f6c23458cd3478 for
USB_LED_TRIG. This config symbol has bool type and enables extra code
in usb_common itself, not a separate driver. Enabling it should not
force usb_common to be built-in!
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name partially-revert-usb-kconfig-using-select-for-usb_co.patch
Vladimir Davydov [Sat, 1 Oct 2016 13:39:09 +0000 (16:39 +0300)]
mm: memcontrol: use special workqueue for creating per-memcg caches
Creating a lot of cgroups at the same time might stall all worker
threads with kmem cache creation works, because kmem cache creation is
done with the slab_mutex held. The problem was amplified by commits
801faf0db894 ("mm/slab: lockless decision to grow cache") in case of
SLAB and
81ae6d03952c ("mm/slub.c: replace kick_all_cpus_sync() with
synchronize_sched() in kmem_cache_shrink()") in case of SLUB, which
increased the maximal time the slab_mutex can be held.
To prevent that from happening, let's use a special ordered single
threaded workqueue for kmem cache creation. This shouldn't introduce any
functional changes regarding how kmem caches are created, as the work
function holds the global slab_mutex during its whole runtime anyway,
making it impossible to run more than one work at a time. By using a
single threaded workqueue, we just avoid creating a thread per each
work. Ordering is required to avoid a situation when a cgroup's work is
put off indefinitely because there are other cgroups to serve, in other
words to guarantee fairness.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=172981
Signed-off-by: Vladimir Davydov <vdavydov.dev@gmail.com>
Reported-by: Doug Smythies <dsmythies@telus.net>
Cc: Christoph Lameter <cl@linux.com>
Cc: David Rientjes <rientjes@google.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Pekka Enberg <penberg@kernel.org>
Acked-by: Michal Hocko <mhocko@suse.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name mm-memcontrol-use-special-workqueue-for-creating-per-memcg-caches.patch
Darrick J. Wong [Tue, 20 Sep 2016 05:52:16 +0000 (22:52 -0700)]
Trouble mounting metadata_csum ext4 filesystems with v4.7.x after
c9274d891869880648c4ee9365df3ecc7ba2e285: not enough inode bytes checksummed?
[cc Ted and the ext4 list]
On Mon, Sep 19, 2016 at 03:19:03PM +0100, Nix wrote:
> So I ran into spurious metadata corruption warnings in v4.7.2 due to the
> problem fixed by
c9274d8. I applied an early version of the fix,
> rebooted, and oh dear root filesystem mount failure with invalid
> checksum errors.
>
> The problem persists in v4.7.4, as seen here in qemu emulation on a raw
> image dd'ed directly from the thing that won't boot, with a couple of
> printk()s:
>
> # mount /dev/vda /new-root/
> [ 8.124692] EXT4-fs (vda): couldn't mount as ext3 due to feature incompatibilities
> [ 8.126977] EXT4-fs (vda): couldn't mount as ext2 due to feature incompatibilities
> [ 9.017980] Inode size 256 > good old size 128; fits in inode: 0
> [ 8.134897] inode 8: provided: 5c50l; calculated: 36e1i
> [ 8.135098] EXT4-fs error (device vda): ext4_iget:4479: inode #8: comm mount: checksum invalid
> [ 8.138992] EXT4-fs (vda): no journal found
> [ 8.165744] UDF-fs: warning (device vda): udf_fill_super: No partition found (2)
> mount: mounting /dev/vda on /new-root/ failed: Invalid argument
>
> I added a bit of printking to show the failure of the journal inode
> checksum to pass muster. e2fsck (from e2fsprogs 1.43.1-14) is quite
> happy with this filesystem. Reverting
c9274d8 makes everything happy
> again (well, it does bring the original bug back, which is a rather
> serious one, but other than that...):
>
> [ 9.823032] EXT4-fs (vda): couldn't mount as ext3 due to feature incompatibilities
> [ 9.824647] EXT4-fs (vda): couldn't mount as ext2 due to feature incompatibilities
> [ 9.832593] inode 8: provided: 5c50l; calculated: 5c50i
> [ 9.839253] inode 2: provided: d6ea92e9l; calculated: d6ea92e9i
> [ 9.846947] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts: (null)
>
> So
c9274d8 is clearly messing up the calculation of the checksum.
>
> The problem becomes more evident if we add more printk()s to the old
> code, so we can see what region is being checksummed:
>
> # mount /dev/vda /new-root
> [ 6.827297] inode 8: unadjusted csum of 256 bytes with seed
a5df92a7:
449a5c50
> [ 6.827596] adjusted csum: 5c50
> [ 6.835993] inode 2: unadjusted csum of 256 bytes with seed
759c6c33:
d6ea92e9
> [ 6.836173] adjusted csum:
d6ea92e9
> [ 6.844801] EXT4-fs (vda): mounted filesystem with ordered data mode. Opts:
>
> and the new:
>
> [ 11.098013] inode 8: csum of first 124 bytes with seed
a5df92a7:
f375b663
> [ 11.098205] inode 8: added csum of 2 dummy_csum bytes with seed
a5df92a7:
20cfebcb
> [ 11.098420] inode 8: added csum of 2 bytes from offset 126 -- 128 to existing:
d79e7432
> [ 11.098646] inode 8: > GOOD_OLD_INODE_SIZE; added csum of 2 bytes from 128 -- 130 to existing:
d10936e1
> [ 11.098890] 8: adjusted csum: 36e1
> [ 11.099133] EXT4-fs error (device vda): ext4_iget:4483: inode #8: comm mount: checksum invalid
>
> We are not checksumming enough bytes! We used to checksum the entire
> 256-byte inode: now, we checksum only 130 bytes of it, which isn't even
> enough to cover the 28-byte extra_isize on this filesystem and is more
> or less guaranteed to give the wrong answer. I'd fix the problem, but I
> frankly can't see how the new code is meant to be equivalent to the old
> code in any sense -- most particularly what the stuff around dummy_csum
> is meant to do -- so I thought it better to let the people who wrote it
> fix it :)
Sh*t, I missed this during the review. So your filesystem image (thank
you!) had this to say:
debugfs> stats
Inode size: 256
debugfs> stat <8>
Size of extra inode fields: 0
Basically, a 128-byte inode inside a filesystem that allocated 256 bytes
for each inode. As you point out, the old code would checksum the entire
allocated space, whether or not the inode core used it. Obviously, you
want this since inline extended attributes live in that space:
csum = ext4_chksum(sbi, ei->i_csum_seed, (__u8 *)raw,
EXT4_INODE_SIZE(inode->i_sb));
The new code, on the other hand, carefully checksums around the
i_checksum fields and only bothers to checksum the space between the end
of i_checksum_hi and the end of the allocated space if the inode core is
big enough to store i_checksum_hi. Since we allocated 256 bytes for
each inode, we checksum the first two bytes after byte 128
(EXT4_GOOD_OLD_INODE_SIZE), but then we see that i_extra_size == 0 so we
never bother to checksum anything after that. This is of course wrong
since we no longer checksum the xattr space and we've deviated from the
pre-4.7.4 (documented) on-disk format.
*FORTUNATELY* since the root inode fails the read verifier, the file (in
this case the root dir) can't be modified and therefore nothing has been
corrupted. Especially fortunate for you, the fs won't mount, reducing
the chances that any serious damage has occurred.
I /think/ the fix in this case is to hoist the last ext4_chksum call
out of the EXT4_FITS_IN_INODE blob:
if (EXT4_INODE_SIZE(inode->i_sb) > EXT4_GOOD_OLD_INODE_SIZE) {
offset = offsetof(struct ext4_inode, i_checksum_hi);
csum = ext4_chksum(sbi, csum, (__u8 *)raw +
EXT4_GOOD_OLD_INODE_SIZE,
offset - EXT4_GOOD_OLD_INODE_SIZE);
if (EXT4_FITS_IN_INODE(raw, ei, i_checksum_hi)) {
csum = ext4_chksum(sbi, csum, (__u8 *)&dummy_csum,
csum_size);
offset += csum_size;
}
csum = ext4_chksum(sbi, csum, (__u8 *)raw + offset,
EXT4_INODE_SIZE(inode->i_sb) - offset);
}
Can you give that a try?
> tune2fs output for this filesystem, particularly the extra_isize and
> inode size fields are likely relevant:
>
> tune2fs 1.43.1 (08-Jun-2016)
> Filesystem volume name: root
> Last mounted on: /
> Filesystem UUID:
6c0f7fa7-d6c2-4054-bff3-
3a878460bdc7
> Filesystem magic number: 0xEF53
> Filesystem revision #: 1 (dynamic)
> Filesystem features: has_journal ext_attr resize_inode dir_index filetype extent 64bit flex_bg sparse_super large_file huge_file dir_nlink extra_isize metadata_csum
> Filesystem flags: signed_directory_hash
> Default mount options: (none)
> Filesystem state: clean
> Errors behavior: Continue
> Filesystem OS type: Linux
> Inode count: 65536
> Block count: 262144
> Reserved block count: 13107
> Free blocks: 227009
> Free inodes: 59499
> First block: 0
> Block size: 4096
> Fragment size: 4096
> Group descriptor size: 64
> Reserved GDT blocks: 63
> Blocks per group: 32768
> Fragments per group: 32768
> Inodes per group: 8192
> Inode blocks per group: 512
> RAID stripe width: 16
> Flex block group size: 64
> Filesystem created: Tue May 26 21:28:46 2009
> Last mount time: Sun Sep 18 23:34:41 2016
> Last write time: Mon Sep 19 13:51:59 2016
> Mount count: 0
> Maximum mount count: 36
> Last checked: Mon Sep 19 13:51:59 2016
> Check interval:
15552000 (6 months)
> Next check after: Sat Mar 18 12:51:59 2017
> Lifetime writes: 16 GB
> Reserved blocks uid: 0 (user root)
> Reserved blocks gid: 0 (group root)
> First inode: 11
> Inode size: 256
> Required extra isize: 28
> Desired extra isize: 28
> Journal inode: 8
> Default directory hash: half_md4
> Directory Hash Seed:
f1da2da0-057e-4ba0-a021-
3d56db5b24ab
> Journal backup: inode blocks
> Checksum type: crc32c
> Checksum: 0x92acf115
>
> This is an old, upgraded fs from before the days of checksums, but even
> so I'm surprised that with a 256-byte inode and no xattrs in use,
> EXT4_FITS_IN_INODE is false. Maybe the extra_isize isn't big enough?
It's zero, so yes. :)
> An lzipped e2image of the problematic filesystem is available from
> <http://www.esperi.org.uk/~nix/temporary/csum-corruption.img.lz>:
> I have verified that the problem recurs with this image.
>
> I can also replicate the problem in literally seconds if you need more
> debugging output.
>
>
> ... The mystery is why this isn't going wrong anywhere else: I have
> metadata_csum working on every fs on a bunch of other ext4-using
> systems, and indeed on every filesystem on this machine as well, as long
> as
c9274d8 is not applied. Many of them are similarly upgraded pre-csum
> fses with the same inode size and extra_isize, but they work...
Hard to say, but this bug only affects inodes with 0 < i_extra_size <= 4
i.e. 128 < inode-core-size <= 130. Maybe an old ext3 fs that was
created with 256 bytes per inode but inode-core-size of 128?
Uck. Sorry about this mess.
--D
[bwh: Converted to a patch]
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name ext4-fix-bug-838544.patch
Ben Hutchings [Fri, 26 Aug 2016 00:31:28 +0000 (01:31 +0100)]
kbuild: Do not use hyphen in exported variable name
This definition in Makefile.dtbinst:
export dtbinst-root ?= $(obj)
should define and export dtbinst-root when handling the root dts
directory, and do nothing in the subdirectories. However, the
variable does not reliably get exported to the environment, perhaps
because its name contains a hyphen.
Rename the variable to dtbinst_root.
References: https://bugs.debian.org/833561
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name kbuild-do-not-use-hyphen-in-exported-variable-name.patch
Ben Hutchings [Wed, 13 Apr 2016 20:48:06 +0000 (21:48 +0100)]
fs: Add MODULE_SOFTDEP declarations for hard-coded crypto drivers
This helps initramfs builders and other tools to find the full
dependencies of a module.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name fs-add-module_softdep-declarations-for-hard-coded-cr.patch
Ian Campbell [Wed, 20 Nov 2013 08:30:14 +0000 (08:30 +0000)]
phy/marvell: disable 4-port phys
The Marvell PHY was originally disabled because it can cause networking
failures on some systems. According to Lennert Buytenhek this is because some
of the variants added did not share the same register layout. Since the known
cases are all 4-ports disable those variants (indicated by a 4 in the
penultimate position of the model name) until they can be audited for
correctness.
[bwh: Also #if-out the init functions for these PHYs to avoid
compiler warnings]
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name disable-some-marvell-phys.patch
Ben Hutchings [Sat, 19 Oct 2013 18:43:35 +0000 (19:43 +0100)]
kbuild: Use -nostdinc in compile tests
Debian's gcc 4.8 pre-includes <stdc-predef.h> by default, which in
turn includes <bits/predefs.h>. This fails when building a 64-bit
kernel and only 32-bit C library headers installed.
The -nostdinc option disables this, though it isn't explicitly
documented. This option is already used when actually building
the kernel.
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name kbuild-use-nostdinc-in-compile-tests.patch
Arnd Bergmann [Thu, 2 Feb 2017 11:38:33 +0000 (12:38 +0100)]
ARM: orion5x: fix Makefile for linkstation-lschl.dtb
The rename of orion5x-lschl.dts needs to be reflected in the Makefile:
make[3]: *** No rule to make target 'arch/arm/boot/dts/orion5x-lschl.dtb', needed by '__build'.
Fixes: 6cfd3cd8d836 ("ARM: dts: orion5x-lschl: More consistent naming on linkstation series")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Gbp-Pq: Topic features/arm
Gbp-Pq: Name ARM-orion5x-fix-Makefile-for-linkstation-lschl.dtb.patch
Roger Shimizu [Mon, 30 Jan 2017 11:07:30 +0000 (20:07 +0900)]
ARM: dts: orion5x-lschl: More consistent naming on linkstation series
DTS files, which includes orion5x-linkstation.dtsi, are named:
orion5x-linkstation-*.dts
So we rename the file below:
arch/arm/boot/dts/orion5x-lschl.dts
to the new name:
arch/arm/boot/dts/orion5x-linkstation-lschl.dts
Because DTS conversion of this device was just introduced in 4.9, Debian
is still using legacy device support, other distros are the same,
so here we won't expect any impact actually.
Fixes: f94f268979a2 ("ARM: dts: orion5x: convert ls-chl to FDT")
Cc: Ashley Hughes <ashley.hughes@blueyonder.co.uk>
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Gbp-Pq: Topic features/arm
Gbp-Pq: Name ARM-dts-orion5x-lschl-More-consistent-naming-on-link.patch